<template>
	<view class="location">
		<map style="width: 100%;height: 1320rpx;" :scale="scale" :latitude="latitude" :longitude="longitude"
			:markers="covers">
		</map>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: 0,
				title: 'map',
				latitude: 0,
				longitude: 0,
				covers: [{
					id: 1,
					latitude: 30.5702,
					longitude: 104.06476,
					iconPath: 'http://ww1.sinaimg.cn/large/006PeBlYgy1gtl38x39wbj608c08ct9b02.jpg',
					width: '40rpx',
					height: '40rpx',
					callout: {
						content: '我的位置',
						display: 'ALWAYS'
					}
				}, {
					id: 2,
					latitude: 30.555292,
					longitude: 104.065841,
					iconPath: 'http://ww1.sinaimg.cn/large/006PeBlYgy1gtl38x39wbj608c08ct9b02.jpg',
					width: '40rpx',
					height: '40rpx',
					callout: {
						content: '老人位置',
						display: 'ALWAYS'
					}
				}],
				scale: 16,
			}
		},
		onLoad(){
			uni.getLocation({
				type: 'wgs84',
				success: (res) => {
					console.log(res)
					this.latitude = res.latitude;
					this.longitude = res.longitude;
				}
			})
		}
	}
</script>

<style>
</style>
